<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <!--  9.先输入一个月份，点击确定，显示当月的天数， 使用 switch case实现 （需要注意判断的是2月的天数 闰年和平年不一样） -->
</body>
<script>
     
     var year=prompt("请输入年份")
     var month=prompt("请输入月份")
     switch(month){
         case "1":
         case "3":
         case "5": 
         case "7": 
         case "8": 
         case "10": 
         case "12": 
             document.write("31天");
             break;
         case "4": 
         case "6": 
         case "9":
         case "11": 
             document.write("30天");
             break;
         default: 
             if(year%4==0&&(year%100!=0||year%400==0)){
                 document.write("29天");
             }else{
                 document.write("28天");
             }
             break;
     }
</script>
</html>